<!--
 * @LastEditors: pmy
 * @LastEditTime: 2023-09-08 09:20:47
 * @FilePath: \bdcar-net\src\views\comlbs\equipmentManagement\switchInfo.vue
-->
<template>
    <el-form :inline="true" :rules="rules" ref="switchRef" :model="updateInfo" :disabled="showWhich == 'detail'"
        label-width="80px">
        <el-form-item label="转移公司" prop="companyId">
            <el-tree-select v-model="updateInfo.companyId" clearable :data="sel_option.companyId"
                :expand-on-click-node="false" :render-after-expand="false" check-strictly :props="{ label: 'label' }"
                node-key="id" filterable placeholder=" " />
        </el-form-item>
    </el-form>
</template>
<script setup>
const updateInfo = ref({
    companyId: null,
})
const { sel_option } = defineProps({
    sel_option: { type: Object },
});
const rules = ref({
    companyId: [{ required: true, message: "转移公司不能为空", trigger: "blur" }],
});
const { proxy } = getCurrentInstance();
function validate() {
    return new Promise((resolve, reject) => {
        proxy.$refs["switchRef"].validate((valid) => {
            if (valid) {
                resolve(true)
            } else {
                resolve(false)
            }
        })
    })
}
defineExpose({
    validate,
    updateInfo,
});
</script>
<style lang='scss' scoped></style>